Tag collision in Radio Frequency Identification (RFID) system increases the time overhead and energy consumption, reduces the speed of recognition. With the increasing number of tags, the collision is more obvious, thus the system performance decreases sharply. In order to solve the problem of collision among multiple tags in RFID system, an optimized anti-collision algorithm for RFID system based on tag grouping was proposed by analyzing frame slotted ALOHA algorithm. The tags of this algorithm were divided into several groups through the Cyclic Redundancy Check (CRC) code which tags carry, then it recorded tag group number and identified each group according to the grouping sequence, therefore the number of tags which simultaneously responded to the reader's order would be reduced. For the problem of timeslot selective confliction in the identification process, the chaotic system was used to generate uniformly distributed pseudorandom numbers, and it was conducive to select timeslots randomly for the tags within identification state, which made the timeslots selection more uniform in a frame and finally reached the purpose of reducing frequency of tag collision. In the comparative experiments with traditional algorithm, the optimization algorithm needed less orders when the number of tags to be identified was equal, and the order number and tag number showed an approximate linear relationship. The tag identification speed improvement of the optimization algorithm was stable at 50% when the number of tags to be identified was less than 256, and the speed improvement increased to 80% when the number of tags to be identified was more than 256. Theoretical analysis and simulation results indicate that the optimization algorithm has faster tag identification speed, and its performance is more obvious with the increasing of the tags.